package net.zxjava.gateway.dao;

import org.apache.commons.lang3.StringUtils;

public class RouteDaoProvider {
	public String getRoutes(String serverName) {
		StringBuilder sql = new StringBuilder(
				"select * from route where project='platform' and (serverName is null or serverName=''  ");

		if (!StringUtils.isEmpty(serverName)) {
			sql.append(" or  serverName=#{serverName})");
		} else {
			sql.append(" )");
		}
		sql.append(" order by serverName ASC");
		return sql.toString();
	}
}
